package com.vr.xuecheng.learning.controller;

import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.vr.xuecheng.base.response.Result;
import com.vr.xuecheng.learning.service.ILearningOpenVideoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hzh
 * @date 2025/04/11
 */
@Slf4j
@RestController
@Tag(name = "学习课程公开接口")
@ApiSupport(author = "hzh", order = 1)
@RequiredArgsConstructor
public class LearningOpenVideoController {
    private final ILearningOpenVideoService learningOpenVideoService;
    @Operation(summary = "获取视频播放媒体地址")
    @GetMapping("/open/learn/getvideo/{course-id}/{teachplan-id}/{media-id}")
    public Result<String> getVideo(@PathVariable("course-id") Long courseId, @PathVariable("teachplan-id") Long teachplanId, @PathVariable("media-id") String mediaId) {
        return Result.ok(learningOpenVideoService.getVideo(courseId, teachplanId, mediaId));
    }

}
